<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/24 0024
 * Time: 10:10
 */

namespace app\index\controller;
use think\Controller;

class BaseController extends Controller
{
    public function _initialize()
    {
        if (!session('id') || !session('user_name')) {
            $this -> error('您尚未登陆系统',url('login/index'));
        }
    }
    public function loginout(){
        session(null);
        $this -> success('退出系统成功',url('login/index'));
    }
}